package com.learn.design.abstractfactory;

import com.learn.design.abstractfactory.adapter.EGMCacheAdapter;
import com.learn.design.abstractfactory.handler.JDKProxy;
import com.learn.design.abstractfactory.service.CacheServiceImpl;
import com.learn.design.abstractfactory.service.ICacheService;

/**
 * @author xuhainan
 * @date 2023/8/1 17:00
 * @region hefei
 */
public class AbstractFactoryTest {

    public static void main(String[] args) {

        ICacheService redisCache = new CacheServiceImpl();
        redisCache.set("redis", "redis");
        System.out.println(redisCache.get("redis"));


        ICacheService egmProxy = JDKProxy.getProxy(ICacheService.class, new EGMCacheAdapter());
        egmProxy.set("egm", "egm");
        System.out.println(egmProxy.get("egm"));

    }
}
